home *** CD-ROM | disk | FTP | other *** search
/ IRIX Base Documentation 1998 November / IRIX 6.5.2 Base Documentation November 1998.img / usr / share / catman / u_man / cat3 / Tk / crtgenhdlr.z / crtgenhdlr
Text File  |  1998-10-30  |  6KB  |  133 lines

  1.  
  2.  
  3.  
  4. TTTTkkkk____CCCCrrrreeeeaaaatttteeeeGGGGeeeennnneeeerrrriiiiccccHHHHaaaannnnddddlllleeeerrrr((((3333TTTTkkkk))))                      TTTTkkkk____CCCCrrrreeeeaaaatttteeeeGGGGeeeennnneeeerrrriiiiccccHHHHaaaannnnddddlllleeeerrrr((((3333TTTTkkkk))))
  5.  
  6.  
  7.  
  8. NNNNAAAAMMMMEEEE
  9.      Tk_CreateGenericHandler, Tk_DeleteGenericHandler - associate procedure
  10.      callback with all X events
  11.  
  12. SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS
  13.      ####iiiinnnncccclllluuuuddddeeee <<<<ttttkkkk....hhhh>>>>
  14.  
  15.      TTTTkkkk____CCCCrrrreeeeaaaatttteeeeGGGGeeeennnneeeerrrriiiiccccHHHHaaaannnnddddlllleeeerrrr(_p_r_o_c, _c_l_i_e_n_t_D_a_t_a)
  16.  
  17.      TTTTkkkk____DDDDeeeelllleeeetttteeeeGGGGeeeennnneeeerrrriiiiccccHHHHaaaannnnddddlllleeeerrrr(_p_r_o_c, _c_l_i_e_n_t_D_a_t_a)
  18.  
  19. AAAARRRRGGGGUUUUMMMMEEEENNNNTTTTSSSS
  20.      Tk_GenericProc   *_p_r_o_c        (in)      Procedure to invoke whenever any
  21.                                              X event occurs on any display.
  22.  
  23.      ClientData       _c_l_i_e_n_t_D_a_t_a   (in)      Arbitrary one-word value to pass
  24.                                              to _p_r_o_c.
  25.  
  26.  
  27. DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
  28.      TTTTkkkk____CCCCrrrreeeeaaaatttteeeeGGGGeeeennnneeeerrrriiiiccccHHHHaaaannnnddddlllleeeerrrr arranges for _p_r_o_c to be invoked in the future
  29.      whenever any X event occurs.  This mechanism is _n_o_t intended for
  30.      dispatching X events on windows managed by Tk (you should use
  31.      TTTTkkkk____CCCCrrrreeeeaaaatttteeeeEEEEvvvveeeennnnttttHHHHaaaannnnddddlllleeeerrrr for this purpose).  TTTTkkkk____CCCCrrrreeeeaaaatttteeeeGGGGeeeennnneeeerrrriiiiccccHHHHaaaannnnddddlllleeeerrrr is
  32.      intended for other purposes, such as tracing X events, monitoring events
  33.      on windows not owned by Tk, accessing X-related libraries that were not
  34.      originally designed for use with Tk, and so on.
  35.  
  36.      The callback to _p_r_o_c will be made by TTTTkkkk____HHHHaaaannnnddddlllleeeeEEEEvvvveeeennnntttt; this mechanism only
  37.      works in programs that dispatch events through TTTTkkkk____HHHHaaaannnnddddlllleeeeEEEEvvvveeeennnntttt (or through
  38.      other Tk procedures that call TTTTkkkk____HHHHaaaannnnddddlllleeeeEEEEvvvveeeennnntttt, such as TTTTkkkk____DDDDooooOOOOnnnneeeeEEEEvvvveeeennnntttt or
  39.      TTTTkkkk____MMMMaaaaiiiinnnnLLLLoooooooopppp).
  40.  
  41.      _P_r_o_c should have arguments and result that match the type TTTTkkkk____GGGGeeeennnneeeerrrriiiiccccPPPPrrrroooocccc:
  42.           typedef int Tk_GenericProc(
  43.                ClientData _c_l_i_e_n_t_D_a_t_a,
  44.                XEvent *_e_v_e_n_t_P_t_r);
  45.      The _c_l_i_e_n_t_D_a_t_a parameter to _p_r_o_c is a copy of the _c_l_i_e_n_t_D_a_t_a argument
  46.      given to TTTTkkkk____CCCCrrrreeeeaaaatttteeeeGGGGeeeennnneeeerrrriiiiccccHHHHaaaannnnddddlllleeeerrrr when the callback was created.
  47.      Typically, _c_l_i_e_n_t_D_a_t_a points to a data structure containing application-
  48.      specific information about how to handle events.  _E_v_e_n_t_P_t_r is a pointer
  49.      to the X event.
  50.  
  51.      Whenever an X event is processed by TTTTkkkk____HHHHaaaannnnddddlllleeeeEEEEvvvveeeennnntttt, _p_r_o_c is called.  The
  52.      return value from _p_r_o_c is normally 0.  A non-zero return value indicates
  53.      that the event is not to be handled further; that is, _p_r_o_c has done all
  54.      processing that is to be allowed for the event.
  55.  
  56.      If there are multiple generic event handlers, each one is called for each
  57.      event, in the order in which they were established.
  58.  
  59.  
  60.  
  61.  
  62.  
  63.                                                                         PPPPaaaaggggeeee 1111
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70. TTTTkkkk____CCCCrrrreeeeaaaatttteeeeGGGGeeeennnneeeerrrriiiiccccHHHHaaaannnnddddlllleeeerrrr((((3333TTTTkkkk))))                      TTTTkkkk____CCCCrrrreeeeaaaatttteeeeGGGGeeeennnneeeerrrriiiiccccHHHHaaaannnnddddlllleeeerrrr((((3333TTTTkkkk))))
  71.  
  72.  
  73.  
  74.      TTTTkkkk____DDDDeeeelllleeeetttteeeeGGGGeeeennnneeeerrrriiiiccccHHHHaaaannnnddddlllleeeerrrr may be called to delete a previously-created
  75.      generic event handler:  it deletes each handler it finds that matches the
  76.      _p_r_o_c and _c_l_i_e_n_t_D_a_t_a arguments.  If no such handler exists, then
  77.      TTTTkkkk____DDDDeeeelllleeeetttteeeeGGGGeeeennnneeeerrrriiiiccccHHHHaaaannnnddddlllleeeerrrr returns without doing anything.  Although Tk
  78.      supports it, it's probably a bad idea to have more than one callback with
  79.      the same _p_r_o_c and _c_l_i_e_n_t_D_a_t_a arguments.
  80.  
  81.      Establishing a generic event handler does nothing to ensure that the
  82.      process will actually receive the X events that the handler wants to
  83.      process.  For example, it is the caller's responsibility to invoke
  84.      XXXXSSSSeeeelllleeeeccccttttIIIInnnnppppuuuutttt to select the desired events, if that is necessary.
  85.  
  86. KKKKEEEEYYYYWWWWOOOORRRRDDDDSSSS
  87.      bind, callback, event, handler
  88.  
  89.  
  90.  
  91.  
  92.  
  93.  
  94.  
  95.  
  96.  
  97.  
  98.  
  99.  
  100.  
  101.  
  102.  
  103.  
  104.  
  105.  
  106.  
  107.  
  108.  
  109.  
  110.  
  111.  
  112.  
  113.  
  114.  
  115.  
  116.  
  117.  
  118.  
  119.  
  120.  
  121.  
  122.  
  123.  
  124.  
  125.  
  126.  
  127.  
  128.  
  129.                                                                         PPPPaaaaggggeeee 2222
  130.  
  131.  
  132.  
  133.